<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>笔记预览</title>
    <link rel="stylesheet" href="/public/css/note-program/main.css">
    <link rel="stylesheet" href="/public/css/note-program/aside-selection.css">
    <link rel="stylesheet" href="/public/css/note-program/text-display.css">
    <link rel="stylesheet" href="/public/editor.md/css/editormd.min.css" />
    <link rel="stylesheet" href="/public/editor.md/css/editormd.preview.css" />
</head>
<body>
    <header id="mobile-header">
    <div class="menu">
        <img src="../../public/resources/logo.png" id="menu-img">
    </div>
    <div class="menu-list" id="menu-list">
        <ul>
            <li>个人计划</li>
            <li>我的笔记</li>
            <li>知识结构</li>
            <li>数据统计</li>
            <li>广场</li>
        </ul>
    </div>
    <div class="header-left">
        <img src="/public/img/logo.png">
        <p>成为更好的自己</p>
    </div>
    <div class="header-nav">
        <span>个人计划</span>
        <span>我的笔记</span>
        <span>知识结构</span>
        <span>数据统计</span>
        <span>广场</span>
        <div class="min-screen-logo">
            <img src="/public/img/logo.png">
            <p>成为更好的自己</p>
        </div>
    </div>
    <div class="header-right">
        <img src="../../public/resources/user-pic.jpg" id="turnUserInfo">
    </div>
</header> 
<div id="editor">
    <div class="click-to-edit" onclick="start_edit();">进入编辑界面</div>
    <textarea id="append-test" style="display:none;">
placeholder
    </textarea>          
</div>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="/public/js/note-program/main.js"></script>
<script src="/public/js/note-program/book_struct.js"></script>
<script src="/public/editor.md/editormd.min.js"></script>
<script src="/public/editor.md/lib/marked.min.js"></script>
<script src="/public/editor.md/lib/prettify.min.js"></script>
<script src="/public/editor.md/lib/raphael.min.js"></script>
<script src="/public/editor.md/lib/underscore.min.js"></script>
<script src="/public/editor.md/lib/sequence-diagram.min.js"></script>
<script src="/public/editor.md/lib/flowchart.min.js"></script>
<script src="/public/editor.md/lib/jquery.flowchart.min.js"></script>
<script type="text/javascript">
    $(function() {
        var testEditormdView, testEditormdView2;
        $.get("test.md", function(markdown) {
            
		    testEditormdView = editormd.markdownToHTML("test-editormd-view", {
                markdown        : markdown ,//+ "\r\n" + $("#append-test").text(),
                htmlDecode      : "style,script,iframe",  // you can filter tags decode
                tocm            : true,    // Using [TOCM]
                markdownSourceCode : true, // 是否保留 Markdown 源码，即是否删除保存源码的 Textarea 标签
                emoji           : true,
                taskList        : true,
                tex             : true,  
                flowChart       : true,  
                sequenceDiagram : true,  
            });
        });
        testEditormdView2 = editormd.markdownToHTML("test-editormd-view2", {
            htmlDecode      : "style,script,iframe",  // you can filter tags decode
            emoji           : true,
            taskList        : true,
            tex             : true,  
            flowChart       : true,  
            sequenceDiagram : true,  
        });
    });
        //     console.log(123)
        // console.log(window.location.href)
        // request('GET','/single-note'+window.location.href,null,(res)=>{
        //     console.lof(res);
        //     document.getElementById('editor').innerHTML=`
        //         <div class="click-to-edit" onclick="start_edit('${book_title}','${note_title}');">进入编辑界面</div>
        //         <div id="test-editormd-view2">
        //             <textarea class="editormd-markdown-textarea" id="append-test" name="test-editormd-markdown-doc" style="display: none;">${res}</textarea>
        //         </div>
        //     `;
        //     // testEditormdView2 = editormd.markdownToHTML("test-editormd-view2", {
        //     // htmlDecode      : "style,script,iframe",  // you can filter tags decode
        //     // emoji           : true,
        //     // taskList        : true,
        //     // tex             : true,  
        //     // flowChart       : true,  
        //     // sequenceDiagram : true,  
        // });
</script>
</body>
</html>